import {
	request
} from "@/utils/request"

// 配件大厅列表
export const getPaginate = (data) => request({
	url: "Goods/getPaginate",
	method: "GET",
	data
})

// 订单列表
export const getOrderPaginate = (data, showLoading = true) => request({
	url: "/Goods/getOrderPaginate",
	method: "GET",
	data,
	showLoading
})
// 配件详情
export const getDetails = (data) => request({
	url: "/Goods/getDetails",
	method: "GET",
	data,
})
// 订单选择
export const getGoodsRealOrderList = (data) => request({
	url: "/Goods/getGoodsRealOrderList",
	method: "GET",
	data,
})
// 下单订单
export const postCreateOrder = (data) => request({
	url: "/Goods/postCreateOrder",
	method: "POST",
	data,
})
// 订单详情
export const getOrderDetails = (data) => request({
	url: "/Goods/getOrderDetails",
	method: "GET",
	data,
})
// 订单确认或取消
export const orderSubmit = (type, data) => {
	const obj = {
		1: '/Goods/postConfirmOrder',
		2: '/Goods/postCancelOrder'
	}
	// type==1则是确认 2是取消
	return request({
		url: obj[type],
		method: "POST",
		data,
	})

}
// 订单详情
export const getGoodsorderCount = (data) => request({
	url: "/Goods/getGoodsorderCount",
	method: "GET",
	data,
})
